//
// Decompiled by Jadx - 399ms
//
package p;

import android.os.Build;
import android.text.TextUtils;
import fn.y;
import gf.o;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.TreeMap;
import me.plusne.NativeTools;
import me.plusne.common.Json.JsonHookStatic;

public final class d extends c {
    public final TreeMap<String, Object> b(TreeMap<String, Object> treeMap) {
        treeMap.put("timeStamp", Long.valueOf(System.currentTimeMillis()));
        treeMap.put("Signature", NativeTools.d(NativeTools.c()));
        JsonHookStatic jsonHookStatic = y.by;
        treeMap.put("VersionName", jsonHookStatic.getMainVersionName());
        treeMap.put("VersionCode", Long.valueOf(jsonHookStatic.getMainVersionCode()));
        treeMap.put("AppVersionName", jsonHookStatic.getVersionName());
        treeMap.put("AppVersionCode", Long.valueOf(jsonHookStatic.getVersionCode()));
        treeMap.put("deviceMedia", jsonHookStatic.getDeviceMedia());
        treeMap.put("deviceName", Build.MANUFACTURER + " " + Build.MODEL + "..");
        treeMap.put("AppPre", jsonHookStatic.getPre());
        treeMap.put("deviceInfo", NativeTools.e());
        treeMap.put("deviceEncode", NativeTools.f());
        treeMap.put("sdkVersion", Integer.valueOf(Build.VERSION.SDK_INT));
        if (!TextUtils.isEmpty(jsonHookStatic.getUUID())) {
            treeMap.put("deviceUuid", jsonHookStatic.getUUID() + "__" + Build.FINGERPRINT);
        }
        try {
            treeMap.computeIfAbsent("token", new o(2));
            if (treeMap.get("user") == null || TextUtils.isEmpty(String.valueOf(treeMap.get("user")))) {
                treeMap.put("user", jsonHookStatic.getUserInfo().getUser());
            }
            treeMap.put("uuid", jsonHookStatic.getUserInfo().getUuid());
        } catch (NullPointerException e) {
            e.printStackTrace();
        }
        TreeMap<String, Object> treeMap2 = new TreeMap<>();
        StringBuilder sb = new StringBuilder();
        for (String str : treeMap.keySet()) {
            if (!str.toString().equals("sign") && treeMap.get(str) != null) {
                Object obj = treeMap.get(str);
                Objects.requireNonNull(obj);
                if (!TextUtils.isEmpty(obj.toString())) {
                    Object obj2 = treeMap.get(str);
                    Objects.requireNonNull(obj2);
                    String str2 = new String(obj2.toString().replace("\n", "<br>").getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8);
                    sb.append((Object) str);
                    sb.append(str2);
                    treeMap2.put(str.toString(), str2);
                }
            }
        }
        treeMap2.put("sign", NativeTools.g(sb.toString().replace("+", "%20")));
        return treeMap2;
    }
}
